/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.web.gwt.basics.manager;

import com.genia.toolbox.web.gwt.basics.bean.FileInformation;

/**
 * the manager that handles file uploads.
 */
public interface GwtFileUploadManager
{

  /**
   * return a new identifier to be used in the client-server communication.
   * 
   * @return a new identifier to be used in the client-server communication
   */
  public abstract Long getNewIdentifier();



  /**
   * get the progress of the upload of a file.
   * 
   * @param id
   *          the identifier of the file to monitor
   * @return the progress of upload of the file (a number between 0 and 100)
   */
  public abstract Integer getUploadProgress(Long id);



  /**
   * returns the {@link FileInformation} associated to a file.
   * 
   * @param id
   *          the identifier of the file which informations must be returned
   * @return the {@link FileInformation} associated to a file
   */
  public abstract FileInformation getFileInformation(Long id);



  /**
   * register a new {@link FileInformation}.
   * 
   * @param fileInformation
   *          the {@link FileInformation} to register
   * @return the session identifier of the refistered {@link FileInformation}
   */
  public Long registerFileInformation(FileInformation fileInformation);

}
